Optimal. Leaf size=32 \[ -b \cos (a) \text {Ci}\left (\frac {b}{x}\right )+x \sin \left (a+\frac {b}{x}\right )+b \sin (a) \text {Si}\left (\frac {b}{x}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.625, Rules used = {3442, 3378,
3384, 3380, 3383} \begin {gather*} -b \cos (a) \text {CosIntegral}\left (\frac {b}{x}\right )+b \sin (a) \text {Si}\left (\frac {b}{x}\right )+x \sin \left (a+\frac {b}{x}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3378
Rule 3380
Rule 3383
Rule 3384
Rule 3442
Rubi steps
\begin {align*} \int \sin \left (a+\frac {b}{x}\right ) \, dx &=-\text {Subst}\left (\int \frac {\sin (a+b x)}{x^2} \, dx,x,\frac {1}{x}\right )\\ &=x \sin \left (a+\frac {b}{x}\right )-b \text {Subst}\left (\int \frac {\cos (a+b x)}{x} \, dx,x,\frac {1}{x}\right )\\ &=x \sin \left (a+\frac {b}{x}\right )-(b \cos (a)) \text {Subst}\left (\int \frac {\cos (b x)}{x} \, dx,x,\frac {1}{x}\right )+(b \sin (a)) \text {Subst}\left (\int \frac {\sin (b x)}{x} \, dx,x,\frac {1}{x}\right )\\ &=-b \cos (a) \text {Ci}\left (\frac {b}{x}\right )+x \sin \left (a+\frac {b}{x}\right )+b \sin (a) \text {Si}\left (\frac {b}{x}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 32, normalized size = 1.00 \begin {gather*} -b \cos (a) \text {Ci}\left (\frac {b}{x}\right )+x \sin \left (a+\frac {b}{x}\right )+b \sin (a) \text {Si}\left (\frac {b}{x}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.05, size = 38, normalized size = 1.19
method | result | size |
derivativedivides | \(-b \left (-\frac {\sin \left (a +\frac {b}{x}\right ) x}{b}-\sinIntegral \left (\frac {b}{x}\right ) \sin \left (a \right )+\cosineIntegral \left (\frac {b}{x}\right ) \cos \left (a \right )\right )\) | \(38\) |
default | \(-b \left (-\frac {\sin \left (a +\frac {b}{x}\right ) x}{b}-\sinIntegral \left (\frac {b}{x}\right ) \sin \left (a \right )+\cosineIntegral \left (\frac {b}{x}\right ) \cos \left (a \right )\right )\) | \(38\) |
risch | \(\frac {b \expIntegral \left (1, -\frac {i b}{x}\right ) {\mathrm e}^{i a}}{2}-\frac {i \pi \,\mathrm {csgn}\left (\frac {b}{x}\right ) {\mathrm e}^{-i a} b}{2}+i \sinIntegral \left (\frac {b}{x}\right ) {\mathrm e}^{-i a} b +\frac {\expIntegral \left (1, -\frac {i b}{x}\right ) {\mathrm e}^{-i a} b}{2}+\sin \left (\frac {a x +b}{x}\right ) x\) | \(79\) |
meijerg | \(-\frac {\sqrt {\pi }\, \cos \left (a \right ) b \left (\frac {4 \gamma -4-4 \ln \left (x \right )+4 \ln \left (b \right )}{\sqrt {\pi }}+\frac {4}{\sqrt {\pi }}-\frac {4 \gamma }{\sqrt {\pi }}-\frac {4 \ln \left (2\right )}{\sqrt {\pi }}-\frac {4 \ln \left (\frac {b}{2 x}\right )}{\sqrt {\pi }}-\frac {4 x \sin \left (\frac {b}{x}\right )}{\sqrt {\pi }\, b}+\frac {4 \cosineIntegral \left (\frac {b}{x}\right )}{\sqrt {\pi }}\right )}{4}-\frac {\sqrt {\pi }\, \sin \left (a \right ) \sqrt {b^{2}}\, \left (-\frac {4 x \,b^{2} \cos \left (\frac {\sqrt {b^{2}}}{x}\right )}{\left (b^{2}\right )^{\frac {3}{2}} \sqrt {\pi }}-\frac {4 \sinIntegral \left (\frac {\sqrt {b^{2}}}{x}\right )}{\sqrt {\pi }}\right )}{4}\) | \(137\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] Result contains complex when optimal does not.
time = 0.34, size = 58, normalized size = 1.81 \begin {gather*} -\frac {1}{2} \, {\left ({\left ({\rm Ei}\left (\frac {i \, b}{x}\right ) + {\rm Ei}\left (-\frac {i \, b}{x}\right )\right )} \cos \left (a\right ) - {\left (-i \, {\rm Ei}\left (\frac {i \, b}{x}\right ) + i \, {\rm Ei}\left (-\frac {i \, b}{x}\right )\right )} \sin \left (a\right )\right )} b + x \sin \left (\frac {a x + b}{x}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 45, normalized size = 1.41 \begin {gather*} b \sin \left (a\right ) \operatorname {Si}\left (\frac {b}{x}\right ) - \frac {1}{2} \, {\left (b \operatorname {Ci}\left (\frac {b}{x}\right ) + b \operatorname {Ci}\left (-\frac {b}{x}\right )\right )} \cos \left (a\right ) + x \sin \left (\frac {a x + b}{x}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sin {\left (a + \frac {b}{x} \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 132 vs.
\(2 (32) = 64\).
time = 7.82, size = 132, normalized size = 4.12 \begin {gather*} -\frac {a b^{2} \cos \left (a\right ) \operatorname {Ci}\left (-a + \frac {a x + b}{x}\right ) + a b^{2} \sin \left (a\right ) \operatorname {Si}\left (a - \frac {a x + b}{x}\right ) - \frac {{\left (a x + b\right )} b^{2} \cos \left (a\right ) \operatorname {Ci}\left (-a + \frac {a x + b}{x}\right )}{x} - \frac {{\left (a x + b\right )} b^{2} \sin \left (a\right ) \operatorname {Si}\left (a - \frac {a x + b}{x}\right )}{x} + b^{2} \sin \left (\frac {a x + b}{x}\right )}{{\left (a - \frac {a x + b}{x}\right )} b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.03 \begin {gather*} \int \sin \left (a+\frac {b}{x}\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________